#ifndef __LOGIN_H__
#define __LOGIN_H__ 

#include <iostream>
#include <unistd.h>
#include <strings.h>
#include <cstring>
#include "common.h"
#include "mysqlDBConnPool.h"
#include "picojson.h"
#include "xmlParse.h"

struct respData
{
  respData()
  {
    success_ = true;
  }
  bool success_;
  std::string message_;
};


struct UserInfo 
{
  UserInfo()
  {
    bzero(this, sizeof(*this));
  }
  char account_[6];
  char passwd_[6];
};

class Login
{
public:
  Login();
  ~Login();
  bool init();
  bool loadConfig();
  
  bool parseParam(std::string param, std::string& account, std::string& passwd);
  picojson::value structToJson(const respData& resp);
  bool login();
private:
  std::string tablename_;

  std::string cur_path_;
  std::string conf_path_;
  std::string logpath_; 
  std::string conf_file_;
  std::string logfile_name_;

  std::string sqlurl_;
  MysqlConnPool* mq_; 

  
};

#endif
